
/*
 * Copyright 2002-2019 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 *版权所有2002-2019原作者。
 *
 *根据Apache许可证2.0版（“许可证”）获得许可；
 *除非符合许可证，否则不得使用此文件。
 *您可以在以下地址获取许可证副本：
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 *除非适用法律要求或书面同意，软件
 *根据许可证分发的内容是按“原样”分发的，
 *无任何明示或暗示的保证或条件。
 *有关管理权限和
 *许可证下的限制。
 */

package org.springframework.aop;

/**
 * Filter that restricts matching of a pointcut or introduction to
 * a given set of target classes.
 *
 * <p>Can be used as part of a {@link Pointcut} or for the entire
 * targeting of an {@link IntroductionAdvisor}.
 *
 * <p>Concrete implementations of this interface typically should provide proper
 * implementations of {@link Object#equals(Object)} and {@link Object#hashCode()}
 * in order to allow the filter to be used in caching scenarios &mdash; for
 * example, in proxies generated by CGLIB.
 *
 * @author Rod Johnson
 * @see Pointcut
 * @see MethodMatcher
 */
/**
 *限制切入点匹配或引入的筛选器
 *一组给定的目标类。
 *
 *＜p＞可以用作｛@link Pointcut｝的一部分或整个
 *以｛@link IntroductionAdvisor｝为目标。
 *
 *＜p＞此接口的具体实现通常应提供适当的
 *｛@link Object#equals（Object）｝和｛@linkObject#hashCode（）｝的实现
 *以便在缓存场景中使用过滤器&mdash；对于
 *例如在CGLIB生成的代理中。
 *
 *@作者Rod Johnson
 *@参见Pointcut
 *@参见MethodMatcher
 */
@FunctionalInterface
public interface ClassFilter {

	/**
	 * Should the pointcut apply to the given interface or target class?
	 * @param clazz the candidate target class
	 * @return whether the advice should apply to the given target class
	 */
	/**
	 *切入点应该应用于给定的接口或目标类吗？
	 *@param clazz候选目标类
	 *@return建议是否应应用于给定的目标类
	 */
	boolean matches(Class<?> clazz);


	/**
	 * Canonical instance of a ClassFilter that matches all classes.
	 */
	/**
	 *匹配所有类的ClassFilter的标准实例。
	 */
	ClassFilter TRUE = TrueClassFilter.INSTANCE;

}
